import {ipcRenderer, contextBridge} from 'electron'
import {electronApi, ElectronChannel} from "./types/ipc";

const api: IElectionApi = {
  openDialog: () => ipcRenderer.invoke(ElectronChannel.openDialog),
  startDrag: (fileName) => {
    ipcRenderer.invoke(ElectronChannel.onDragStart, fileName)
  }
}

contextBridge.exposeInMainWorld(electronApi, api)
